UIComponent
| Kind of class: | class |
|---|---|
| Inherits from: | MovieClip |
| Known subclasses: | |
| Classpath: | gfx.core.UIComponent |
| File last modified: | Tuesday, 29 June 2010, 09:03:27 |
The UIComponent is the basis for all components in the Scaleform framework. It contains functionality found in all components such as initialization, focus management, invalidation, sizing, and events.
Component metadata:
| InspectableList | "disabled" "enableInitCallback" "soundMap" "visible" |
|---|
Summary
Instance properties
- focusTarget
- The container or related component that should receive actual focus when this component is given focus.
- initialized
- Indicates if the component has been complete loaded.
- enableInitCallback
- Whether or not this component should fire a callback to the engine after initialization
- soundMap
- Mapping between events and sound process
- addEventListener
- Mixed in from EventDispatcher
- removeEventListener
- Mixed in from EventDispatcher
- hasEventListener
- Mixed in from EventDispatcher
- removeAllEventListeners
- Mixed in from EventDispatcher
- disabled
- Enables or disables the component.
- visible
- Show or hide the component.
- width
- Gets and sets the width of the component using internal sizing mechanisms.
- height
- Gets and sets the height of the component using internal sizing mechanisms.
- focused
- Get and set the focus of the component.
- displayFocus
- Set the component to display itself as focused, even if it is not.
Class methods
- createInstance
- Static helper method to create CLIK components dynamically form a library symbol and also perform required initial invalidation.
Instance methods
- setSize
- Sets the width and height of the component at the same time using internal sizing mechanisms.
- handleInput
- Handle input from the game, via controllers or keyboard.
- invalidate
- An internal property of the component has changed, requiring a redraw.
- validateNow
- When the component has been invalidated, this method is called which validates the component, and redraws the component immediately by calling draw().
- dispatchEventToGame
- This method is called to notify the back-end when a bound control fires an event.
Instance properties
disabled
disabled:Boolean
(read,write)
Enables or disables the component. Disabled components should not receive mouse, keyboard, or any other kind of focus or interaction. Note that "disabled" is used in place of "enabled" to because "enabled" can not be overridden.
displayFocus
displayFocus:Boolean
(read,write)
Set the component to display itself as focused, even if it is not. This property is used by container components to make them appear focused.
enableInitCallback
enableInitCallback:Boolean = true
(read,write)
Whether or not this component should fire a callback to the engine after initialization
focused
focused:Number
(read,write)
Get and set the focus of the component. This property is explicitly called by the FocusHandler When the stage or application focus is given to this component, but can also be set manually on the component to set or clear focus. Currently, an application can have only a single focus. When the focus on a component changes, a "focusIn" or "focusOut" event is fired.
focusTarget
focusTarget:Object
(read,write)
The container or related component that should receive actual focus when this component is given focus.
height
height:Number
(read,write)
Gets and sets the height of the component using internal sizing mechanisms. Use this instead of
_height. Use setSize.() to set both the width and the height at the same time. initialized
initialized:Boolean = false
(read,write)
Indicates if the component has been complete loaded.
soundMap
soundMap:Object = { theme:"default", focusIn:"focusIn", focusOut:"focusOut" }
(read,write)
Mapping between events and sound process
visible
visible:Boolean
(read,write)
Show or hide the component. Allows the
_visible property to be overridden, and dispatch a "show" or "hide" event. width
width:Number
(read,write)
Gets and sets the width of the component using internal sizing mechanisms. Use this instead of
_width. Use setSize.() to set both the width and the height at the same time. Class methods
createInstance
static function createInstance (
context:MovieClip,
symbol:String,
name:String,
depth:Number,
initObj:Object) : MovieClip
Static helper method to create CLIK components dynamically form a library symbol and also perform required initial invalidation.
Instance methods
dispatchEventToGame
function dispatchEventToGame (
event:Object) : Void
This method is called to notify the back-end when a bound control fires an event.
handleInput
Handle input from the game, via controllers or keyboard. The default handleInput will handle standalone and composite components.
Parameters:
details :
An
InputDetails object containing details from the interaction.pathToFocus:
A list of children in the focus path that are below this component. Components are responsible for calling
handleInput() on the next component in the pathToFocus unless they choose to intercept the call.Returns:
- A Boolean value specifying if the focus was handled or not by this component or sub-components. This suggests to components higher up in the focus path that they should not also handle the input.
See also:
invalidate
function invalidate (
) : Void
An internal property of the component has changed, requiring a redraw. The invalidation mechanism lets components trigger multiple redraw commands at the same time, resulting in only a single redraw. the
invalidate() method is public so that it can be called externally. setSize
function setSize (
width:Number,
height:Number) : Void
Sets the width and height of the component at the same time using internal sizing mechanisms.
Parameters:
width :
The new width of the component.
height:
The new height of the component.
validateNow
function validateNow (
) : Void
When the component has been invalidated, this method is called which validates the component, and redraws the component immediately by calling
draw(). The validateNow() method is public so that it can be called externally.